#!perl -T

use strict;
use warnings;
use Test::More tests => 5;
use Test::BoostUnit qw(:ALL);


my %h1 = (
ONE => 1,
TWO => 1,
THREE => 1,
FOUR => 1,
FIVE => 1,
SIX => 1,
SEVEN => 1,
);

my %h2 = (
ONE => 2,
TWO => 3,
THREE => 2,
FOUR => 0,
FIVE => 2,
SIX => 0,
SEVEN => 2,
);

my %h3 = (
ONE => 2,
TWO => 3,
THREE => 1,
FOUR => 1,
FIVE => 2,
SIX => 0,
SEVEN => 2,
);


my %h4 = (
ONE => 2,
TWO => 3,
THREE => 1,
FOUR => 1,
FIVE => 2,
SIX => 0,
SEVEN => 2,
EIGHT => 1,
NINE => 0,
);


is_deeply(
{generateConfusionMatrix({VECTOR1 => \%h1,VECTOR2 => \%h2})},
{
 1 => {0 => 2, 3 => 1, 2 => 4,},
}, 
"No Match" );
is_deeply(
{generateConfusionMatrix({VECTOR1 => \%h1,VECTOR2 => \%h1})},
{
 1 => {1 => 7,},
}, 
"All Matches" );
is_deeply(
{generateConfusionMatrix({VECTOR1 => \%h1,VECTOR2 => \%h3})},
{
 1 => {0 => 1, 1 => 2, 3 => 1, 2 => 3,},
}, 
"Two Matches" );
is_deeply(
{generateConfusionMatrix({VECTOR1 => \%h1,VECTOR2 => \%h4})},
{
 1 => {0 => 1, 1 => 2, 3 => 1, 2 => 3,},
}, 
"Two Matches - Extra Keys" );
is_deeply(
{generateConfusionMatrix({VECTOR1 => \%h3,VECTOR2 => \%h4})},
{
 0 => {0 => 1, 1 => 0, 2 => 0, 3 => 0,}, 
 1 => {0 => 0, 1 => 2, 2 => 0, 3 => 0,}, 
 2 => {0 => 0, 1 => 0, 2 => 3, 3 => 0,},
 3 => {0 => 0, 1 => 0, 2 => 0, 3 => 1,},
 }, 
"All Matches - Extra Keys" );
